import { _decorator, Component, UITransform, Widget } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('HomeBG')
export class HomeBG extends Component {

	private ui_background: UITransform

	protected onLoad(){
		this.init();
	}

    protected start(){
		this.adaptUI();
    }

	private init(){
		this.ui_background = this.node.getChildByName('background').getComponent(UITransform);
	}

	private adaptUI(){
		let wgt = this.node.getComponent(Widget);
		if(wgt){
			wgt.updateAlignment();
		}
		mtec.cc.adaptBackgroundNode(this.ui_background.node);
	}
}
